1. Field of the Invention
The present invention relates to the technical field of universal serial bus (USB) and, more particularly, to a method and system for universal serial bus (USB) image capturing with two isochronous transfers.
2. Description of Related Art
With the advance of image extraction and processing, the image capturing device is evolved from a traditional camera into a digital camera. The digital cameras are in widespread use nowadays. Image obtained by a digital camera is stored as a digital image file in, for example, an embedded memory medium or removable memory card. The resolution of a digital camera is much higher than that of a viewfinder, so that a USB is typically used to transfer digital image files to a computer for image processing by the corresponding software of the computer.
The USB transfers can be divided into: (1) control transfer; (2) interrupt transfer; (3) bulk transfer; and (4) isochronous transfer, wherein the isochronous transfer is employed to proceed data transfer without considering data errors. Therefore, digital cameras generally use the isochronous transfer for increasing the transfer rate to a computer.
Digital cameras typical use a single isochronous transfer. In this case, the driver of a computer activates a transmission channel for a video stream to call a function, named “USBCAMD_SelectConfiguration”, thereby obtaining the required USB bandwidth and associated encoder/decoder. In addition, the driver calls a function, named “SBCAMD_PrepareChannel”, to activate an image transmission channel for the video stream of a digital camera. Furthermore, the driver calls a function, named “USBCAMD_ReadChannel)”, to read the frames from the image transmission channel.
FIG. 1 is a schematic diagram of an isochronous transfer on a USB, wherein the measures on the USB are obtained by using a USB analyzer.
As shown in FIG. 1, a transfer of packet 122238 includes transactions 20876, 20877, and 20878, a transfer of packet 122245 includes transactions 20879 and 20880, and a transfer of packet 122250 includes transactions 20881, 20882, and 20883. Either one of the packets is output at the first endpoint of a typical digital camera. Since the endpoint is unique in typical digital cameras, the USB in FIG. 1 supports only one endpoint.
FIG. 2 is a schematic diagram of data processing of a typical driver. The driver sequentially combines data of the transactions 20876, 20877, and 20878 into packet 1, data of the transactions 20879 and 20880 into packet 2, and data of the transactions 20881, 20882, and 20883 into packet 3. The subsequent steps are the same, and thus no further detail is described. When a complete frame of data is received, the driver sequentially copies packets 1, 2, and 3 to a buffer RawFrameBuffer.
Since the typical digital camera has only one endpoint and the USB supports only one endpoint in USB Video Class, the driver calls the function “USBCAMD_SelectConfiguration” to thereby obtain a bandwidth of 24 MB/sec. only. However, the resolution of digital camera is getting higher, resulting in that the single endpoint and corresponding bandwidth cannot quickly transfer images obtained by a digital camera to a host.
Therefore, it is desirable to provide an improved method and system for universal serial bus (USB) camera with two isochronous transfers to mitigate and/or obviate the aforementioned problems.